package com.csmk.springboot_simple.config;


import com.csmk.springboot_simple.common.CustomNumberDeserializer;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JacksonConfig {
    @Bean
    public SimpleModule customIntegerDeserializerModule() {
        SimpleModule module = new SimpleModule();
        module.addDeserializer(Integer.class, new CustomNumberDeserializer<>(Integer.class));
        module.addDeserializer(Long.class, new CustomNumberDeserializer<>(Long.class));
        return module;
    }

}
